package br.inf.solutions.apresentacoes.ssp.model.hierarchy;

import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import br.com.vexillum.model.annotations.SearchField;
import br.com.vexillum.model.annotations.Validate;
import br.com.vexillum.model.annotations.ValidatorClass;
import br.inf.solutions.apresentacoes.ssp.model.basics.BasicCommon;

@SuppressWarnings("serial")
@ValidatorClass(validatorClass = "br.inf.solutions.apresentacoes.ssp.control.validator.ModelNameValidator")
@Entity
@Table(name="model_name")
public class ModelName extends BasicCommon {

	@Validate(notNull=true)
	@SearchField
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "id_type", nullable = false, updatable = true, unique = false)
	private HierarchyStructType type;

	public HierarchyStructType getType() {
		return type;
	}

	public void setType(HierarchyStructType type) {
		this.type = type;
	}
	
}
